
import React from 'react';
import { Button, Tooltip } from 'antd';

import { QuestionCircleOutlined } from '@ant-design/icons';
import { FormattedMessage } from 'umi';

export interface DocHelperProps {
    page: string,
    title?: any,
    dataStep?:string
    dataIntro?:string,
}
const docUrl = 'https://www.yuque.com/books/share/ac4c0470-4b8c-406e-9709-0045ba7703ce/';
const DocHelper: React.FC<DocHelperProps> = (props: DocHelperProps) => {

    return (
        <Tooltip title={props.title ? props.title : <FormattedMessage id="Help" />}>            
            <Button
                type="link"
                icon={<QuestionCircleOutlined />}
                onClick={()=>window.open(docUrl + props.page,'_blank')}
                data-step={props.dataStep}
                data-intro={props.dataIntro} />
        </Tooltip>
    )
}
export default DocHelper;